<?php

namespace app\model;

use app\util\Tools;

class UserDeposit extends Base
{
    protected $autoWriteTimestamp = true;
    protected $resultSetType = 'collection';
    protected $updateTime = 'updateTime';
    protected $createTime = 'addTime';

    public function getStatusTextAttr($value, $data)
    {
        //0-申请中。1-提现成功，-1 - 提现失败
        $status = ['0' => '申请中', '1' => '通过', '2' => '拒绝'];
        return $status[$data['status']];
    }

    public function setMoneyAttr($value)
    {
        return $value * 100;
    }

    public function getMoneyAttr($value)
    {
        return Tools::bcCalculate($value, 100, '/');
    }
}
